define(function () {
    'use strict';
    function ctrl($scope, $state, CommonService, WebService) {
        function init() {
            $scope.userMessages = [
                {id: 1, title: '【测试数据】 奥数覅打算发射点发生懂啊放', date: new Date(2016, 7, 16, 17, 55), readed: false},
                {id: 2, title: '【测试数据】 大师傅撒旦飞洒的发撒发萨佛萨芬萨佛撒', date: new Date(2016, 7, 16, 13, 55), readed: false},
                {id: 3, title: '【测试数据】 士大夫十大发士大夫十大发撒发收费的', date: new Date(2016, 7, 16, 9, 55), readed: false},
                {id: 4, title: '【测试数据】 大师傅士大夫撒发撒发生啊发生地发生地发撒地', date: new Date(2016, 7, 11, 3, 55), readed: true},
                {id: 5, title: '【测试数据】 大师傅士大夫撒发撒发生啊发生地发生地发撒地方上', date: new Date(2016, 7, 9, 3, 55), readed: true},
                {id: 6, title: '【测试数据】 大师傅士大夫撒发撒发生啊发生地发生', date: new Date(2016, 7, 8, 3, 55), readed: true}];
        }

        $scope.$on('$ionicView.beforeEnter', function () {
            init();
        });

        $scope.detail = function (id) {
            $state.go('tab.account-detail', {messageId: id});
        }
    }

    ctrl.$inject = ['$scope', '$state', 'CommonService', 'WebService'];
    return ctrl;
});